package md.mru.frontend.utils;

import java.util.EnumSet;
import java.util.HashSet;
import java.util.Set;

/**
 * Enum class contains constants mapped with
 * rows from folder_states table by id.
 *
 * @author sergiu.marin
 * @since 21/06/2014.
 */
public enum FolderStateType {
    NEW             (1),
    EMPLOYED        (2),
    DISCHARGED      (3),
    SUSPENDED       (4),
    MATERNITY_LEAVE (5),
    HOLIDAY         (6),
    VALIDATED       (7),
    AWAY            (8),
    TRAINING        (9),
    WORK_INCAPACITY (10);

    public final Long folderStateId;

    private static final EnumSet<FolderStateType> EXPIRES_FOLDER_STATE_TYPES = EnumSet.of(HOLIDAY, MATERNITY_LEAVE,SUSPENDED, AWAY, TRAINING, WORK_INCAPACITY);

    FolderStateType(long folderStateId) {
        this.folderStateId = folderStateId;
    }

    public static Set<Long> getExpiresFolderStatesIds() {
        Set<Long> ids = new HashSet<>();
        for (FolderStateType folderState : EXPIRES_FOLDER_STATE_TYPES) {
            ids.add(folderState.folderStateId);
        }
        return ids;
    }

}
